<form action="language.manage.php" id="form_del" name="form_del" method="post">
<input type="hidden" name="action" id="action" value="del" />
<table border="0" cellpadding="0" cellspacing="0" class="from_table2_one">
		<thead>
		<tr class="area_ajax_list_title">
		<th width="35"></th>	
		<th width="100"><tpl> $langLanguageName </tpl></th>	
		<th width="100"><tpl> $langLanguageSign </tpl></th>	
		<th width="100"><tpl> $langLanguagePath </tpl></th>
		<th width="100"><tpl> $langLanguageDefault </tpl></th>
		<th width="100"><tpl> $langLanguageSort </tpl></th>
		<th width="150"><tpl> $langLanguageOperation </tpl></th>
		</tr>
		</thead>
		<tpl> if $language_array[0].language_id neq '' </tpl>
			<tpl> section name=i loop=$language_array </tpl>
				<tr>
				
					<td><input name="language_id[]" type="checkbox" value="<tpl> $language_array[i].language_id </tpl>"/></td>	
				  <td width="100"><tpl> $language_array[i].language_name </tpl></td>
					<td width="100"><tpl> $language_array[i].language_sign </tpl></td>
					<td width="100"><tpl> $language_array[i].language_path </tpl></td>
					<td width="100">
						<tpl> if $language_array[i].language_state eq '0' </tpl>
							<tpl> $langLanguageNo </tpl>
						<tpl> else </tpl>
							<font color="#FF0000"><tpl> $langLanguageYes </tpl></font>
						<tpl> /if </tpl>
				  </td>
					<td width="100"><tpl> $language_array[i].language_sort </tpl></td>
					<td width="150"><a href="javascript:;" onclick="hideMessage();ajax_modi('<tpl> $language_array[i].language_id </tpl>');" title="<tpl> $langLanguageEdit </tpl>" class="edit_a_pic" ></a><a href="javascript:;" onclick="set_default('<tpl> $language_array[i].language_id </tpl>');" title="<tpl> $langLanguageSetDefault </tpl>" class="set_a_pic"></a>
				  </td>
				</tr>
			<tpl> /section </tpl>
			
		<tpl> else  </tpl>
			<tr>
				<td colspan="7"><tpl> $langLanguageLNotContent </tpl></td>
			</tr>
		<tpl> /if </tpl>
  </table>
  <tpl> if $language_array[0].language_id neq '' </tpl>
  <div class="table-5-bottom">
  	<div style="float:left; padding-left:20px">
						<span class="btn_left">
						<input name="selectall" type="button" id="selectall" class="btn_submit" value="<tpl> $langLanguageSelAll </tpl>" />
						</span>
							<span class="btn_left">
						<input name="negative" type="button" id="negative" class="btn_submit" value="<tpl> $langLanguageNegative </tpl>" /></span>
							<span class="btn_left">
						<input name="delbutton" type="button" id="delbutton" class="btn_submit" value="<tpl> $langLanguageDel </tpl>" /></span>
						
					</div>
					<div style="float:right; padding-right:20px"><tpl> $page_list </tpl></div>
  </div>
  <tpl> /if </tpl>
</form>
<div id="question" style="display:none; cursor: default; padding:10px"> 
        <b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-top:10px; padding-bottom:10px"><tpl> $langLanguageLConfirmDel </tpl></b> <br />
        <input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
        <input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
</div> 
<script>
$(document).ready(function() {	
	var question = $('#question')[0];
	$('#negative').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
		);
	$('#selectall').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',true)
			})
		}
	);
	//删除操作
	var options_del = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("language.manage.php?action=ajax_list<tpl> if $language_array|@count neq 1 </tpl>&curpage=<tpl> $curpage </tpl><tpl> /if </tpl>");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	
	$("#delbutton").click(function(){
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
			$.unblockUI();
			$('#form_del').ajaxSubmit(options_del);	
			return false;
		});
	$('#no').click($.unblockUI);
});	

//编辑
function ajax_modi(id){
	//载入页面
	ShowDiv = "result_content";
	getPageContent("language.manage.php?action=modify&id="+id+"&curpage=<tpl> $curpage </tpl>");
}
//设置默认
function set_default(id){
	$.ajax({
		url: "language.manage.php",
		data: "action=set_default&id="+id,
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
			if(msg.type == 1){
				ShowDiv = "result_content";
				getPageContent("language.manage.php?action=ajax_list&curpage=<tpl> $curpage </tpl>");
			}
		}
	});
	return false;
}
</script>